package cn.ptu.pmaa.service;

import cn.ptu.pmaa.entities.FeedBack;
import cn.ptu.pmaa.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    @Autowired
    UserMapper userMapper;

    public Object getUserInfo(String id,String role){
        if (role.equals("admin")){
            return userMapper.getAdminInfo(id);
        }else if(role.equals("teacher")){
            return userMapper.getTeacherInfo(id);
        }else{
            return userMapper.getStudentInfo(id);
        }
    }

    public int uploadBack(FeedBack feedBack){
        return userMapper.uploadBack(feedBack);
    }

}
